﻿@{
    ViewBag.Title = "Home Page";
    Layout = "~/Views/Shared/layoutCommon.cshtml";
}
@section bodyClass
{
   class="hold-transition skin-blue sidebar-mini";
}

@model CGT.OP.Common.UserInfo

<div class="wrapper">
    <!-- header  -->
    <header class="main-header">
        <!-- Logo -->
        <a href="'@Url.Action("", "Home")" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <div class="logo-mini">
                <div class="img-box">
                    <img src="@Url.Content("~/images/logo-white-mini.png")" alt="斑马车务" />
                </div>

            </div>
            <!-- logo for regular state and mobile devices -->
            <div class="logo-lg">
                <div class="img-box">
                    <img src="@Url.Content("~/images/logo-white-large.png")" alt="斑马车务" />
                </div>

            </div>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- 菜单显示隐藏按钮 -->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only"></span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">

                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="@Url.Content("~/images/avatar.png")" class="user-image" alt="User Image">
                            <span class="hidden-xs">@Model.UserName</span>

                        </a>
                        <ul class="dropdown-menu">
                            <li class="menu">
                                <a style="padding: 10px;" href="@OF.Security.PassportClientSettings.GetConfig().LogOffUrl">
                                    <i class="fa fa-fw fa-sign-out"></i>
                                    退出
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>



        </nav>
    </header>

    <!-- 左侧导航 -->
    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu" data-widget="tree"></ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <iframe id="menuFrame" name="menuFrame" src="" style="overflow:visible;" scrolling="auto" frameborder="no" height="100%" width="100%"></iframe>
    </div>
</div>
<!-- ./wrapper -->
@section scriptsBottom{
<script src="@Url.Content("~/js/sidebarMenu.js")"></script>
    <script type="text/javascript">
        $("#menuFrame").height(window.innerHeight - 56);
        var url = '@Url.Action("GetMenuList", "Home")'
        BMCW.ajax({
            url: url,
            type: "Get",
            success: function (o) {
                var obj = eval('(' + o + ')');
                if (obj.status == 0) {
                    var list = obj.data;
                    var json = "";
                    var pm = [];
                    for (var i = 0; i < list.length; i++) {
                        var sparam = [];
                        for (var j = 0; j < list[i].Children.length; j++) {
                            var clist = list[i].Children[j];
                            sparam.push({ "id": clist.MenuID, "text": clist.MenuName, "icon": "fa fa-circle-o", "url": clist.MenuUrl, "targetType": "iframe" });
                        }
                        pm.push({ "id": list[i].MenuID, "text": list[i].MenuName, "icon": "fa fa-laptop", "children": sparam });
                    }
                    json = JSON.stringify(pm);
                    $('.sidebar-menu').sidebarMenu({ data: eval(json) });

                }
            }
        });


    </script>
}